<template lang="html">
  <!-- 在首页父组件发送http请求,后将数据通过props传递给子组件,可减少请求次数,减少服务器压力 -->
  <div class="index">
    <v-header/>
    <v-section1 :list="datas"/>
    <v-baseline/>
    <v-footer/>
  </div>
</template>

<script lang="js">
  import Header from '@/components/index/header.vue'
  import Section1 from '@/components/index/section1.vue'
  import Baseline from '@/common/_baseline.vue'
  import Footer from '@/common/_footer.vue'
  import { wxLogin } from './mixins/wxLogin.js'
  export default {
    mixins: [wxLogin],
    components: {
      'v-header': Header,
      'v-section1': Section1,
      'v-baseline': Baseline,
      'v-footer': Footer
    },
    data() {
      return {
        datas: [],
        loading: true
      }
    },

    beforeCreate() {
      this.$api({
        method: 'get',
        url: '/courseInfo/list'
      }).then((response) => {
        console.log(response.data.data)
        this.datas = response.data.data;

      }).catch(function(error) {
        alert(error)
      })
    }
  }
</script>



<style lang="less" scoped>
.index {
    width: 100%;
    padding-bottom: 14vw;
    background-color: #F8FCFF;
}
</style>
